Opsgenie

To be able to send notifications with argocd-notifications you have to create an API Integration inside your Opsgenie Team.

  1. Login to Opsgenie at https://app.opsgenie.com or https://app.eu.opsgenie.com (if you have an account in the european union)
  2. Make sure you already have a team, if not follow this guide https://docs.opsgenie.com/docs/teams
  3. Click “Teams” in the Menu on the left
  4. Select the team that you want to notify
  5. In the teams configuration menu select “Integrations”
  6. Click “Add Integration” in the top right corner
  7. Select “API” integration
  8. Give your integration a name, copy the “API key” and safe it somewhere for later
  9. Click “Edit” in the integration settings
  10. Make sure the checkbox for “Create and Update Access” is selected, disable the other checkboxes to remove unnecessary permissions
  11. Click “Save” at the bottom
  12. Click “Turn on integration” in the top right corner
  13. Check your browser for the correct server apiURL. If it is “app.opsgenie.com” then use the US/international api url api.opsgenie.com in the next step, otherwise use api.eu.opsgenie.com (European API).
  14. You are finished with configuring Opsgenie. Now you need to configure argocd-notifications. Use the apiUrl, the team name and the apiKey to configure the Opsgenie integration in the argocd-notifications-secret secret.
  15. You can find the example argocd-notifications-cm configuration at the below.
OptionRequiredTypeDescriptionExample
descriptionTruestringDescription field of the alert that is generally used to provide a detailed information about the alert.Hello from Argo CD!
priorityFalsestringPriority level of the alert. Possible values are P1, P2, P3, P4 and P5. Default value is P3.P1
aliasFalsestringClient-defined identifier of the alert, that is also the key element of Alert De-Duplication.Life is too short for no alias
noteFalsestringAdditional note that will be added while creating the alert.Error from Argo CD!
  1. apiVersion: v1
  2. kind: ConfigMap
  3. metadata:
  4. name: argocd-notifications-cm
  5. data:
  6. service.opsgenie: |
  7. apiUrl: <api-url>
  8. apiKeys:
  9. <your-team>: <integration-api-key>
  10. template.opsgenie: |
  11. message: |
  12. [Argo CD] Application {{.app.metadata.name}} has a problem.
  13. opsgenie:
  14. description: |
  15. Application: {{.app.metadata.name}}
  16. Health Status: {{.app.status.health.status}}
  17. Operation State Phase: {{.app.status.operationState.phase}}
  18. Sync Status: {{.app.status.sync.status}}
  19. priority: P1
  20. alias: {{.app.metadata.name}}
  21. note: Error from Argo CD!
  22. trigger.on-a-problem: |
  23. - description: Application has a problem.
  24. send:
  25. - opsgenie
  26. when: app.status.health.status == 'Degraded' or app.status.operationState.phase in ['Error', 'Failed'] or app.status.sync.status == 'Unknown'
  1. Add annotation in application yaml file to enable notifications for specific Argo CD app.

    1. apiVersion: argoproj.io/v1alpha1
    2. kind: Application
    3. metadata:
    4. annotations:
    5. notifications.argoproj.io/subscribe.on-a-problem.opsgenie: <your-team>